<?php
!function_exists('adminmsg') && die('Forbidden');
if($_POST['action'])
{
	require_once(R_P.'require/class_cache.php');
	switch ($action)
	{
		case 'cate':
			Cache::writeCache('cate');
			break;
		case 'homepage':
			require_once(R_P.'require/class_action.php');
			$action = new Action('pubindex');
			$action->doIt();
			break;
		case 'template':
			$fp = opendir(D_P.'data/tpl_cache');
			while ($filename = readdir($fp)) {
				if($filename=='..' || $filename=='.') continue;
				@unlink(D_P.'data/tpl_cache/'.$filename);
			}
			break;
		case 'sql':
			$fp = opendir(D_P.'data/sql');
			while ($filename = readdir($fp)) {
				if($filename=='..' || $filename=='.') continue;
				@unlink(D_P.'data/tpl_cache/'.$filename);
			}
			break;
		case 'fileicon':
			require_once(R_P . 'require/class_cache.php');
			Cache::writeCache('config');
			//print_r($icon);
			break;		
		case 'mod':
			Cache::sql();
			break;
		case 'modconfig':
			$cachebbs = new Cache();
			$cachebbs->bbs_config();
			break;
	}
	adminmsg('operate_success');
}
require PrintEot('header');
require PrintEot('set_cache');
adminbottom();

?>